package com.shermanzhou.springbootflowable.demo.custom.mapper;

import org.apache.ibatis.annotations.Insert;

import java.util.Map;

/**
 * @author zhouchaoqun02
 * @date 2020-06-14 19:41
 */
public interface CustomActUpdateMapper {

    @Insert({
            "<script>",
            "insert into ${table}",
            "<foreach collection=\"entity.keys\" item=\"key\" open=\"(\" close=\")\" separator=\",\" > ",
            "${key}",
            "</foreach>",
            "values",
            "(",
            "   <foreach collection=\"entity.keys\" item=\"key\" separator=\",\">",
            "       #{entity[${key}]}",
            "   </foreach>",
            ")",
            "</script>"
    })
    Integer insert(String table, Map<String, Object> entity);
}
